package com.j283_5.wisdom_park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.j283_5.wisdom_park.pojo.CustomerDevelopment;
import com.j283_5.wisdom_park.vo.contract_management.CustomerNeedsVo;
import com.j283_5.wisdom_park.vo.contract_management.CustomerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 客户发展表 Mapper 接口
 * </p>
 *
 * @author laoda
 * @since 2022-04-28
 */
@Mapper
public interface CustomerDevelopmentMapper extends BaseMapper<CustomerDevelopment> {

    /**
     * 多条件查询客户信息
     * @param customerVo
     * @return
     */
    List<CustomerVo> findCustomer(
            @Param("customerVo") CustomerVo customerVo,
            @Param("start")
                    Integer start,
            @Param("limit")
                    Integer limit
    );

    /**
     * 查条数
     * @param customerVo
     * @return
     */
    Long findCustomerCount(
            @Param("customerVo") CustomerVo customerVo
    );

    /**
     * 根据客户id查询客户基本信息
      * @param cus_id
     * @return
     */
    List<CustomerVo> findCustomerById(
        @Param("cus_id") Integer cus_id
    );

    /**
     * 根据客户id查询客户需求信息
     * @param cus_id
     * @return
     */
    List<CustomerNeedsVo> findCustomerNeedById(
            @Param("cus_id") Integer cus_id
    );

    /**
     * 编辑客户信息
     * @param customerNeedsVo
     * @param customerVo
     * @return
     */
    int updateCustomerInfo(
            @Param("customerNeedsVo") CustomerNeedsVo customerNeedsVo,
            @Param("customerVo") CustomerVo customerVo
    );

    /**
     * 根据客户id查询跟进情况
     * @return
     */
    List<CustomerVo> Follow_situation(
            @Param("cus_id") Integer cus_id
    );

    /**
     * 新增客户
     * @param customerNeedsVo
     * @param customerVo
     * @return
     */
    int insertCustomer(
            @Param("customerNeedsVo") CustomerNeedsVo customerNeedsVo,
            @Param("customerVo") CustomerVo customerVo
    );

}
